<template>
  <footer class="footer">
    <div class="footer-content">
      <div class="footer-col">
        <div class="footer-logo">
          <img src="path/to/logo.png" alt="Website Logo" />
        </div>
        <p class="footer-desc">探索世界的美好，记录旅行的感动，分享最实用的旅游攻略</p>
      </div>
      <div class="footer-col">
        <h4>网站导航</h4>
        <ul>
          <li><a href="/"><i class="fas fa-home"></i> 首页</a></li>
          <li><a href="/destinations"><i class="fas fa-map-marker-alt"></i> 目的地</a></li>
          <li><a href="/guideView"><i class="fas fa-book-open"></i> 攻略</a></li>
          <li><a href="/travelogues"><i class="fas fa-pen-fancy"></i> 游记</a></li>
        </ul>
      </div>
      <div class="footer-col">
        <h4>关于我们</h4>
        <ul>
          <li><a href="/about"><i class="fas fa-info-circle"></i> 关于我们</a></li>
          <li><a href="/contact"><i class="fas fa-envelope"></i> 联系我们</a></li>
          <li><a href="/privacy"><i class="fas fa-shield-alt"></i> 隐私政策</a></li>
          <li><a href="/terms"><i class="fas fa-file-alt"></i> 使用条款</a></li>
        </ul>
      </div>
      <div class="footer-col">
        <h4>关注我们</h4>
        <div class="social-media">
          <a href="#" class="social-link"><i class="fab fa-weixin"></i></a>
          <a href="#" class="social-link"><i class="fab fa-weibo"></i></a>
          <a href="#" class="social-link"><i class="fab fa-instagram"></i></a>
          <a href="#" class="social-link"><i class="fab fa-youtube"></i></a>
        </div>
        <div class="newsletter">
          <h4>订阅最新资讯</h4>
          <div class="newsletter-form">
            <input type="email" v-model="newsletterEmail" placeholder="请输入您的邮箱" />
            <button @click="subscribeNewsletter"><i class="fas fa-paper-plane"></i></button>
          </div>
        </div>
      </div>
    </div>
    <div class="copyright">
      &copy; {{ currentYear }} 旅游攻略网. 保留所有权利。
    </div>
  </footer>
</template>

<script setup>
import { ref, computed } from 'vue';

// 邮箱订阅相关
const newsletterEmail = ref('');

// 计算当前年份
const currentYear = computed(() => new Date().getFullYear());

// 订阅邮箱
const subscribeNewsletter = () => {
  if (newsletterEmail.value) {
    // 调用API进行订阅
    console.log('订阅邮箱', newsletterEmail.value);
    // 订阅成功后清空输入
    newsletterEmail.value = '';
    // 显示成功消息
    alert('订阅成功！');
  }
};
</script>

<style scoped>
/* 页脚样式 */
.footer {
  background-color: #1a1a1a;
  color: white;
  padding: 60px 5% 30px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.footer-col h4 {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
  color: white;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background-color: #0e9aa7;
}

.footer-logo img {
  height: 45px;
  margin-bottom: 15px;
}

.footer-desc {
  color: #ccc;
  line-height: 1.6;
  margin-bottom: 20px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col ul li {
  margin-bottom: 12px;
}

.footer-col ul li a {
  color: #ccc;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.footer-col ul li a:hover {
  color: #0e9aa7;
  transform: translateX(5px);
}

.social-media {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #333;
  color: white;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.social-link:hover {
  background-color: #0e9aa7;
  transform: translateY(-3px);
  box-shadow: 0 5px 10px rgba(14, 154, 167, 0.3);
}

.newsletter-form {
  display: flex;
  margin-top: 15px;
}

.newsletter-form input {
  flex: 1;
  padding: 10px 15px;
  border: none;
  border-radius: 20px 0 0 20px;
  background-color: #333;
  color: white;
  outline: none;
}

.newsletter-form button {
  padding: 10px 15px;
  background-color: #0e9aa7;
  color: white;
  border: none;
  border-radius: 0 20px 20px 0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.newsletter-form button:hover {
  background-color: #057885;
}

.copyright {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #333;
  color: #999;
  font-size: 0.9rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .footer-content {
    grid-template-columns: 1fr;
  }
}
</style>